package com.cloud.cloudvideo.rabbitmq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author James.li
 * @version 1.0
 * @date 2020-03-21 13:11
 */
@Component
public class MsgProducer {

    @Autowired

    private RabbitTemplate rabbitTemplate;

    /**
     * 发送消息
     */

    public void sendMsg(String content) {
        rabbitTemplate.convertAndSend(RabbitConfig.EXCHANGE_VIDEO_TRANSCODE, RabbitConfig.ROUTINGKEY_VIDEO_TRANSCODE, content);
    }
}